package com.xinghen.provider.service;

import com.github.pagehelper.PageInfo;
import com.xinghen.common.base.model.dto.MessageQueryDto;
import com.xinghen.common.base.model.response.RestResult;
import com.xinghen.common.base.model.vo.MqMessageVo;
import com.xinghen.provider.UacApiConstant;
import com.xinghen.provider.service.hystrix.UacMqMessageApiHystrix;
import com.xinghen.security.feign.OAuth2FeignAutoConfiguration;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author xinghen
 * @ClassName: UacMqMessageFeignApi
 * @Package: com.xinghen.provider.service
 * @Description uac mq message service api
 * @create 2018/4/17 10:24
 */
@FeignClient(value = UacApiConstant.UAC_FEIGN_CLIENT_NAME, configuration = OAuth2FeignAutoConfiguration.class,
        fallback = UacMqMessageApiHystrix.class)
public interface UacMqMessageFeignApi {

    @PostMapping(value = "/api/uac/message/queryMessageKeyList")
    RestResult<List<String>> queryMessageKeyList(@RequestParam("messageKeyList") List<String> messageKeyList);

    @PostMapping(value = "/api/uac/message/queryMessageListWithPage")
    RestResult<PageInfo<MqMessageVo>> queryMessageListWithPage(@RequestBody MessageQueryDto messageQueryDto);
}
